 const {getCart} = require('../../http/api')
module.exports ={
  add(){
    getCart(wx.getStorageSync('token')).then(res=>{
          console.log(res)
          if(res.data.code==0){
            wx.setTabBarBadge({
              index: 3,
              text:`${res.data.data.number}`,
            })
          }else{
            wx.removeTabBarBadge({
              index:3,
            })
          }
      })
  }
}